Passed
Pull Request — master (#2)
by Luís
03:43 queued 02:00
created

Movies.search   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
nc 2
nop 3
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 9.4285
c 1
b 0
f 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A 0 3 1
1
import App from "app";
2
3
function Movies() {
4
    this.serviceName = "Movies";
5
    this.basepath = "//www.omdbapi.com/";
6
7
    this.Request = App.ServicesContainer.get("AJAX");
8
    this.EM = App.EventManager;
9
}
10
11
Movies.prototype.search = function (term, onSuccess, onError) {
12
    this.Request.send('get', this.basepath, {s: term}, function (res) {
13
        onSuccess(res.body.Search || []);
14
    }, onError);
15
}
16
17
export default Movies;
18